package com.exam.danangtranel.Shopping;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import com.exam.danangtranel.adapter.TbShoppingAdapter;
import com.exam.danangtranel.filed.Tbshopping;
import com.example.danangtravel.DataAccess;
import com.example.danangtravel.R;
import com.example.danangtravel.R.id;
import com.example.danangtravel.R.layout;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class Tbshopping_thcho extends Activity {
	public TbShoppingAdapter adapter;
	public List<Tbshopping> list;
	public ListView listview;
	public DataAccess dataaccess;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_tbshopping_thsieuthi);
		listview = (ListView) findViewById(R.id.list_sieuthi);
		try {
			dataaccess = new DataAccess(this);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		dataaccess.open();
		list = new ArrayList<Tbshopping>();
		list = dataaccess.getAllShopping("2");
		adapter = new TbShoppingAdapter(this, list);
		listview.setAdapter(adapter);
		dataaccess.close();
	}

}
